score = 2


def func1():
    global lst
    lst = []
    a = "abcdefghijklmnopqrstuvwzyz"
    for i in a:
        if i in pwd:
            lst.append(1)
    return func2()


def func2():
    b = "ABCDEFGHIJKIMNOPQRDTUVWXYZ"
    for i in b:
        if i in pwd:
            lst.append(2)
    return func3()


def func3():
    c = "0123456789"
    for i in c:
        if i in pwd:
            lst.append(3)
    return func4()


def func4():
    global score
    d = "~!@#$%^&*()_+{}:\"|<>?`[];\'\\,./-="
    for i in d:
        if i in pwd:
            lst.append(4)
    myset = set(lst)
    if len(myset) >= 3:
        score+=1
        print("符合至少有3种字符，加1分")
    return func5()


def func5(n=2):
    global score
    for i in pwd:
        if len(pwd) <= 3:
            return func6()
        elif pwd[n - 2] == pwd[n - 1] == pwd[n]:
            break
        else:
            n = n + 1
            if n == len(pwd) - 1:
                break
    if n == len(pwd) - 1:
        score+=1
        print("符合没有连续3个或3个以上的字符，加1分")
    return func6()


def func6():
    global score
    if len(pwd) >= 8:
        score+=1
        print("符合密码大于8位，加1分")
    print("分数等级为：", score)


def main():
    global pwd
    pwd = input("请输入你的密码：")
    return func1()


main()
